<template>
	<view class="tp-bgf">
		<view class="center_combo tp-h88 tp-fz32 tp-fw600">
			{{textTitle}}
		</view>
		<view class="tp-pd30">
			<jyf-parser :html="context" ref="article"></jyf-parser>
		</view>
	</view>
</template>

<script>
	import jyfParser from "@/components/jyf-parser/jyf-parser.vue";
	export default {
		components: {
			jyfParser
		},
		data() {
			return {
				type: 1, // 1.新手指引 3.购买须知,4.出行攻略5.拼车费用说明6.租车押金规则说明7.关于我们8.用户协议 9.司机规范10.邀请规则
				textTitle: '', // 标题
				context: '', // 内容
			};
		},
		onLoad(opt) {
			this.type = opt && opt.type
			uni.setNavigationBarTitle({
				title: opt.name
			});
			this.getInfo()
		},
		methods: {
			// 获取数据
			getInfo() {
				this.$http.get(this.$api.orderText, {
					type: this.type,
				}).then(res => {
					if (res.code === 200) {
						this.textTitle = res.data.list[0].textTitle
						this.context = res.data.list[0].context
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.page {
	padding: 30rpx;
	min-height: 100vh;
	background-color: #fff;
}
</style>
